package javawdw.security.dao.impl;

import java.util.List;

import javawdw.security.dao.ResourceDao;
import javawdw.security.entity.Resource;

@SuppressWarnings("unchecked")
public class ResourceDaoImpl extends AbstractDaoImpl<Resource> implements ResourceDao {
	private static final String FIND_BY_ROLEID = "SELECT re FROM Resource re, RoleResource rr WHERE rr.resource.id=re.id AND rr.role.id=?";

	public List<Resource> findByRoleId(String roleId) {
		return getHibernateTemplate().find(FIND_BY_ROLEID, roleId);
	}
}
